package com.devshephard.nio.serversocket.normal.client;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

public class ClientSocketChannelDemo {
    public static void main(String[] args) throws IOException {
        SocketChannel sc = SocketChannel.open();
        sc.connect(new InetSocketAddress("localhost", 8082));
        ByteBuffer buffer = ByteBuffer.allocate(10);
        sc.write(buffer);
        System.out.println("waiting...");
        sc.finishConnect();
    }
}
